"""
打印多边形
"""


import numpy as np
import matplotlib.pyplot as plt

plt.figure()


xx = np.array([
        [3.6, 2.0],
        [5.0, 5.0],
        [5.0, -1.0],
        [-0.3999999999999999, 2.0],
        [1.0, 5.0],
        [1.0, -1.0],
        [-0.3999999999999999, -2.0],
        [1.0, 1.0],
        [1.0, -5.0],
        [3.6, -2.0],
        [5.0, 1.0],
        [5.0, -5.0],
    ])


# xx = np.array([
#         [-0.4, 2],
#         [5, -5],
#         [-0.4, -2],
# ])

xx = np.array([
        [-0.4, 2],
        [5, -5],
        [1, -5],
])

t1 = plt.Polygon(xx, color='yellow')
plt.gca().add_patch(t1)

plt.scatter(xx[:, 0], xx[:, 1], s=30)
plt.scatter([0], [0], s=170)

plt.show()